<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>计算属性的setter和getter</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<script src="../js/vue.js"></script>
	
	</head>
	<body>
			<div id="app">
				{{fullName}}
			</div>
			
			
			<script>
				var vm=new Vue({
					el:'#app',
					data:{
						firstName:'Dell',
						lastName:'Lee'
					},
					computed:{
						fullName:{
							get:function(){
								this.firstName+' '+this.lastName;
							},
							set:function(value){
								var arr =value.split(' ');
								this.firstName=arr[0];
								this.lastName=arr[1];
								console.log(value);
							}
						}
					}
					
				})
			</script>
	</body>
</html>